home *** CD-ROM | disk | FTP | other *** search
/ Amiga Plus 2000 #1 / Amiga Plus CD - 2000 - No. 1.iso / Tools / Grafik / Paint / Perfectpaint / rexx / general / SaveAnimGif.rx < prev    next >
Encoding:
Text File  |  1999-12-03  |  1.8 KB  |  112 lines

  1. /*     arexx Script 
  2.     SAVE Anim in GIF format
  3.     need in 'PerfectPaint/tools':
  4.     - tapgif
  5.     - WhirlGif
  6. */
  7.  
  8.     options results
  9.     parse ARG Port b
  10.     
  11.     ADDRESS value Port
  12.        options results
  13.  
  14.     pp_CountFrames
  15.     nb=result
  16.     if nb<2 then do
  17.         pp_Warn 'Make*an*Anim*first.'
  18.         EXIT
  19.     end
  20.  
  21.     pp_DialogInit 250 100 "*Save*AnimGif*" 4
  22.         pp_String 0 55 8 150 16 "Name" 1 100 "ram:Noname.GIF"
  23.         pp_Getfile 1 210 9 0 "Save*AnimGif" 0 "ram:"
  24.         pp_Cycle 2 105 28 100 16 "Transparency" 1 "No|Color*0|Current*Bg" 0
  25.         pp_Cycle 3 105 48 100 16 "Disposal*method" 1 "None|Not|Background|Previous" 0
  26.     pp_Dialog        
  27.  
  28.     rc=result
  29.     if rc=0 then
  30.         do
  31.             EXIT
  32.         end    
  33.  
  34.     pp_GetDialog 0
  35.     file=result
  36.     file2='PerfectPaint:temp/temp'
  37.  
  38.     pp_GetDialog 2
  39.     option=result
  40.  
  41.     pp_GetDialog 3
  42.     option2=result
  43.  
  44.     if option2=0 then
  45.     DO
  46.     dispose='none'
  47.     END
  48.  
  49.     if option2=1 then
  50.     DO
  51.     dispose='not'
  52.     END
  53.  
  54.     if option2=2 then
  55.     DO
  56.     dispose='back'
  57.     END
  58.  
  59.     if option2=3 then
  60.     DO
  61.     dispose='prev'
  62.     END
  63.  
  64.     if option=2 then
  65.     DO
  66.         pp_GetBpen
  67.         Bpen=result
  68.     END
  69.  
  70.     if option=1 then
  71.     DO
  72.         Bpen=0
  73.     END
  74.  
  75.     pp_asay 'Saving*GIF*file|Please*wait*...'
  76.     
  77.     filetemp="ram:temp"
  78.     CALL OPEN(out,filetemp,write)
  79.  
  80.     do i=1 to nb
  81.         pp_GotoFrame i    
  82.         pp_save 'ram:t/pptemp' 0
  83.         file3=file2||i
  84.         pp_GetJiffies
  85.         jiffies=result
  86.         address COMMAND
  87.         'perfectpaint:tools/tapgif '||'ram:t/pptemp '||'"'||file3||'"'
  88.         'delete >nil: ram:t/pptemp'
  89.         CALL WRITELN(out,file3)
  90.         ADDRESS value Port
  91.     end        
  92.     pp_CloseAsay
  93.     pp_asay 'Making*Animation|Please*wait*...'
  94.  
  95.     address COMMAND
  96.     CALL CLOSE(out)
  97.  
  98.     if option=0 then
  99.     DO
  100.     'perfectpaint:tools/WhirlGif -o '||'"'||file||'"'||' -loop '||'-disp '||dispose||' -i ram:temp'    
  101.     END
  102.     ELSE
  103.     DO
  104.     'perfectpaint:tools/WhirlGif -o '||'"'||file||'"'||' -loop -trans '||Bpen||' -disp '||dispose||' -i ram:temp'
  105.     END
  106.     'delete >nil: PerfectPaint:Temp/?#.*'
  107.  
  108.     ADDRESS value Port
  109.     pp_CloseAsay
  110.  
  111.     address COMMAND
  112.     'delete >nil: ram:temp'